package vv.lines.view.swing;

import vv.lines.core.IActionHandler;
import vv.lines.core.ActionId;

import javax.swing.*;
import java.awt.event.ActionEvent;

/**
 * @author vpotapenko
 */
public class ViewAction extends AbstractAction {

    private ActionId id;
    private IActionHandler handler;

    public ViewAction(ActionId id, String name, IActionHandler handler) {
        super(name);
        this.id = id;
        this.handler = handler;
    }

    public void actionPerformed(ActionEvent e) {
        handler.handleAction(id);
    }
}
